package com.linkoog.devtools.icon_viewer;

import com.linkoog.devtools.icon_viewer.converters.ExtendedImageConverter;
import com.linkoog.devtools.icon_viewer.converters.RegularImageConverter;
import com.linkoog.devtools.icon_viewer.converters.SVGImageConverter;

import java.util.Arrays;
import java.util.List;

public class ImageConverterFactory {

    /**
     */
    private static List<ImageToIconConverter> CONVERTERS = Arrays.asList(new RegularImageConverter(),new SVGImageConverter(),new ExtendedImageConverter());


    public static ImageToIconConverter create(String fileName){
        return CONVERTERS.stream().filter(imageToIconConverter -> imageToIconConverter.isAccepted(fileName)).findFirst().orElse(null);
    }

}
